package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the TOMO_FOLIO database table.
 * 
 */
@Embeddable
public class TomoFolioPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private long refnumPart;
	private long nsCade;

    public TomoFolioPK() {
    }

	@Column(name="REFNUM_PART", unique=true, nullable=false)
	public long getRefnumPart() {
		return this.refnumPart;
	}
	public void setRefnumPart(long refnumPart) {
		this.refnumPart = refnumPart;
	}

	@Column(name="NS_CADE", unique=true, nullable=false, precision=4)
	public long getNsCade() {
		return this.nsCade;
	}
	public void setNsCade(long nsCade) {
		this.nsCade = nsCade;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof TomoFolioPK)) {
			return false;
		}
		TomoFolioPK castOther = (TomoFolioPK)other;
		return 
			(this.refnumPart == castOther.refnumPart)
			&& (this.nsCade == castOther.nsCade);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.refnumPart ^ (this.refnumPart >>> 32)));
		hash = hash * prime + ((int) (this.nsCade ^ (this.nsCade >>> 32)));
		
		return hash;
    }
}